﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
//new
using System.IO;

namespace JKZP
{
    public partial class HPZLForm : Form
    {
        public HPZLForm()
        {
            InitializeComponent();
        }

        private void HPZLForm_Load(object sender, EventArgs e)
        {
            try
            {
                textBox1.Lines = File.ReadAllLines(PP.gHPZLFile);
            }
            catch { }
        }

        private void button_save_Click(object sender, EventArgs e)
        {
            try
            {
                if (textBox1.Lines.Length > 0)
                {
                    File.WriteAllLines(PP.gHPZLFile, textBox1.Lines);
                    ((Form_Main)this.Owner).UpdateCombobox();

                    if (PP.gISWebVersion == false)
                    {
                        this.toolStripStatusLabel1.Text = "保存成功";
                    }
                    else
                    {
                        if (PP.kdws.JKZP_UploadHPZL(textBox1.Text) == true)
                        {
                            this.toolStripStatusLabel1.Text = "保存成功";
                        }
                        else
                        {
                            this.toolStripStatusLabel1.Text = "保存失败";
                        }
                    }
                }
            }
            catch { }
        }

        private void button_exit_Click(object sender, EventArgs e)
        {
            Close();
        }
    }
}
